package api.list.practice;

import collection.list.Point;

import java.io.PipedOutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortString {
    public static void main(String[] args) {

       /* List<collection.list.Point> list = new ArrayList<>();
        list.add(new collection.list.Point(3, 5));
        list.add(new collection.list.Point(52, 7));
        list.add(new collection.list.Point(1, 9));
        list.add(new collection.list.Point(63, 14));
        list.add(new collection.list.Point(4, 787));
        list.add(new Point(74, 56));*/
        List<String> list = new ArrayList<>();
        list.add("第六届阿斯利康");
        list.add("底扫");
        list.add("建瓯盘服务器哦");
        list.add("华法林后");
        list.add("分红按时间哦i");
        System.out.println("排序前" + list);


        Collections.sort(list, (o1,  o2)-> o1.length()-o2.length());


        /*Collections.sort(list, new Comparator<Point>() {
            @Override
            public int compare(Point o1, Point o2) {
                return o1.getX()-o2.getX();
            }
        });*/

        System.out.println(list);
    }
}
